home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / PC / EDACS.ZIP / EDACS.TXT < prev   
Internet Message Format  |  1997-12-28  |  18KB

  1. From qwertyuiop10@juno.com Tue Dec 23 21:11:26 1997
  2. From: qwertyuiop10@juno.com
  3. Subject: (LONG) EDACS control channel monitoring with your computer
  4. Date: Tue, 23 Dec 1997 23:11:26 -0600
  5. Message-ID: <882938742.863371268@dejanews.com>
  6. Newsgroups: rec.radio.scanner
  7. Organization: Deja News Posting Service
  8. Path: ix.netcom.com!zdc!super.zippo.com!lotsanews.com!newsfeed.direct.ca!logbridge.uoregon.edu!nntp2.dejanews.com!grunt.dejanews.com!not-for-mail
  9. X-Article-Creation-Date: Wed Dec 24 04:45:43 1997 GMT
  10. X-Authenticated-Sender: qwertyuiop10@juno.com
  11. X-Http-User-Agent: Mozilla/3.04 (Win95; I)
  12. X-Originating-IP-Addr: 152.201.110.239 (201-110-239.ipt.aol.com)
  13. Lines: 336
  14. Xref: ix.netcom.com rec.radio.scanner:115771
  15.  
  16.          How to monitor the EDACS trunked radio control channel
  17.                          (First of 2 postings)
  18. ------------------------------------------------------------------------
  19.  
  20.                              INTRODUCTION
  21.  
  22.      This posting gives a rather sketchy summary of the operation of
  23. Ericsson GE's EDACS trunked radio control channel, describes an op amp
  24. interface that connects between your PC compatible's serial port and
  25. your radio scanner's discriminator, and lastly includes a C program
  26. listing that decodes and displays the trunked radio system activity on
  27. your screen. This single op amp interface along with some slight program
  28. modifications described later will allow one to construct an "EDACS
  29. TrunkTracker" that passes active working frequencies to your scanner,
  30. automatically detects the end of voice transmissions (incidentally also
  31. eliminating the anti-scanner tones), and returns to the control channel
  32. to await the next frequency assignment.
  33.  
  34.      It is hoped that someone else will be able to pick up the ball,
  35. correct the inevitable misconceptions and errors in this posting, and
  36. develop a much nicer feature laden package (as has happened with the
  37. trunker program for monitoring Motorola's trunked radio control
  38. channel). As with the original trunker program posting, anyone who so
  39. desires should feel free to take anything useful from this posting in
  40. developing their own freeware / shareware / whatever product.
  41.  
  42.  
  43. ---------------------------------------------------------------------
  44.  
  45.                      EDACS Control Channel Information
  46.  
  47.  
  48.  
  49. Modulation  : It looks like GMSK (Gaussian Minimum Shift Keying) which
  50.               is basically the same thing as two level FSK keying except
  51.               that the data stream is passed through a low pass filter
  52.               before modulating the carrier. This reduces the high
  53.               frequency components allowing the control channel to fit
  54.               within a 12.5KHz channel. Accordingly, a simple
  55.               data-slicer circuit can be used to receive the control
  56.               channel information.
  57.  
  58.  
  59. Baud Rate   : 9600 Baud
  60.  
  61.  
  62. Frame Sync  : Frame synchronization is achieved by sending the following
  63.               48 bit sequence:
  64.  
  65.                 000101010101010101010111000100100101010101010101
  66.  
  67.               or
  68.  
  69.                 0x155557125555 Hexadecimal
  70.  
  71.  
  72. Data Frames : After transmission of the frame synchronization sequence
  73.               TWO data frames will be transmitted and then the whole
  74.               cycle repeats ad infinitum. Each data frame is 120 bits
  75.               long; this means 288 bits are transmitted in each cycle
  76.               (2x120 bits for the data frames and 48 bits for frame
  77.               sync).
  78.  
  79.               Each data frame consists of 40 bits of information
  80.               transmitted three times in a row. In the second
  81.               transmission the data is inverted. This seems to serve as
  82.               some sort of primitive error correction scheme - in case
  83.               of a receive error one may assume that the one bit that
  84.               doesn't match the other two is bad.
  85.  
  86.               The 40 information bits in each data frame seem to have
  87.               the following functions:
  88.  
  89.                    Bits        Function
  90.                    -------     ----------------------------------------
  91.                     0 - 7   :  These eight bits are the command bits
  92.                     8 - 12  :  Logical channel number
  93.                      13     :  Status bit
  94.                      14     :  Status bit
  95.                      15     :  Status bit
  96.                      16     :  Status bit; guess at possible use:
  97.                                  group call if set to zero, individual
  98.                                  call if set to one (radio ID then is
  99.                                  given by bits 17 - 27)
  100.                    17 - 19  :  Agency   ID (3 bits) for group call
  101.                    20 - 23  :  Fleet    ID (4 bits) for group call
  102.                    24 - 27  :  Subfleet ID (4 bits) for group call
  103.                    28 - 39  :  Error detection polynomial
  104.  
  105.               The above tentative table seems to work well for the few
  106.               systems the I have monitored. The exact use of the status
  107.               bits are at present unknown to the me. The basic call
  108.               type in an EDACS system is a group call, although
  109.               individual radios IDs can also be sent for such tasks as a
  110.               phone patch.
  111.  
  112.  
  113. Commands :    The few commands the I have figured out are:
  114.  
  115.                        CMD     Function
  116.                        ---     --------------------------------------
  117.                        A0h  :  Data channel assignment
  118.                        A1h  :  Data channel assignment
  119.                        ECh  :  Phone patch channel assigment
  120.                        EEh  :  Voice channel assignment
  121.                        FCh  :  IDLE
  122.                        FDh  :  ID bits give system ID; don't know if
  123.                                status bits should be part of system ID
  124.  
  125.               There must be a number of additional commands for such
  126.               tasks as dynamic regrouping or disabling radios.
  127.  
  128. -----------------------------------------------------------------------
  129.  
  130.                   A few words about those digital data
  131.                  transmissions you might sometimes hear
  132.  
  133.  
  134.      It would be of interest to be able to monitor those digital data
  135. transmissions that can be an integral part of some EDACS systems. This
  136. program is a first step in that direction since it allows one to
  137. determine when and on which channels these transmissions take place.
  138. These transmissions take place at 9600 baud and can be monitored with
  139. the same interface used for the control channel. The following
  140. information was gathered from monitoring the data transmissions on a
  141. single commercial SMR trunk (unknown use), some of it might be relevant
  142. to other systems.
  143.  
  144. The first part of the transmission consists of 144 bit frames. The first
  145. 48 bits are the following frame sync sequence:
  146.  
  147.             101010101010101010101010101010101000010110110011
  148.  
  149. The next 96 bits are 4 bytes encoded as follows: byte number one is sent
  150. three times in a row (all bits inverted the second time), then bytes two
  151. through four follow similarly. The same frame is repeated a number of
  152. times, presumably to allow enough time for radios to switch to the data
  153. channel and achieve bit and frame synchronization. During this period
  154. the transmitted bytes are 0xD4, 0x00, 0x1A, and 0x33; presumably
  155. indicating an idle / background state. After enough time has elapsed,
  156. the four bytes are changed to indicate that actual data follows. For all
  157. the messages I have monitored these bytes are 0xC4, 0x00, 0x18, and
  158. 0xF2; presumably indicating what type of data follows. At this point the
  159. actual data transmission starts, the frame sync sequence will not be
  160. sent until after the actual data transmission is complete. The first
  161. part of the data tranmission consists of two 40 bit blocks, each
  162. transmitted three times with all bits inverted the second time around.
  163. Next, 72 bytes are transmitted - each byte is sent twice (not three
  164. times) with all bits inverted the second time. Some additional
  165. redundancy is built since the first 27 bytes are always the same as the
  166. last 27 bytes. Since this concludes the actual data transmission the
  167. system starts transmitting the background / idle 144 bit frame again.
  168. For this system the idle frame is sent maybe a dozen times, then a frame
  169. containing data bytes 0x9A, 0xAA, 0xA2, 0xC0 is transmitted about 6
  170. times; presumably commanding the radio to return to the control channel.
  171.  
  172.  
  173. -----------------------------------------------------------------------
  174.  
  175.                             THE INTERFACE
  176.  
  177.      Due to the 9600 baud rate, you must have access to the
  178. discriminator output on your scanner. The interface is basically a one
  179. op amp Hamcomm type which can be used for a variety of other decoding
  180. tasks as well. The following is an ascii drawing lifted without
  181. permission out of the documentation for Peter Baston's PD203 Pocsag
  182. pager decoding shareware package with some slight modifications
  183. (basically to eliminate the Schmitt trigger). This happens to be the
  184. circuit I am currently using.
  185.  
  186.  
  187. >
  188. >   0.1 uF                    |\ +12v
  189. > ---||-----------------------|- \|
  190. >DISC IN   |                  |LF  \
  191. > ----     |                  |411 /--------------------- Data Out
  192. >     |    \            ------|+ /|                       CTS (pin 5/8)
  193. >     |    / 1M         |     |/-12v                   or DSR (pin 6/6)
  194. >     |    \            |
  195. >    GND   /            |                      GND ------ GND (pin 7/5)
  196. >          |            |
  197. >          |            |                  N.B. Pin Numbers for com port are
  198. >         GND          GND                 given as x/y, where x is for a 25
  199. >                                          way, y for a 9 way.
  200. >
  201. >
  202.  
  203.     If you want this device to obtain power as a parasite off the serial
  204. port you can try the following circuit (also from the PD203
  205. documention). It is slightly modified to get rid of the connection to
  206. the TxD line which one presumably wants to use to send control
  207. information to a radio scanner.
  208.  
  209. >
  210. >
  211. >
  212. >             --------------|<-------------------------------------- -12v
  213. >             |                            |                  |
  214. >             | RTS (4/7) --------|<--------       GND        - -
  215. >             |          |                          |         _ +  10uF
  216. >             |           --------->|-------        - -       |
  217. >             |           Diodes 1N4148    |        - + 10uF  GND
  218. >             |                            |        |
  219. > DTR (20/4) --------------->|-------------------------------------- +12v
  220. >
  221.  
  222.  
  223.  
  224. ------------------------------------------------------------------------
  225.  
  226.                   Things you need to know before you
  227.                 can make your own "EDACS TrunkTracker"
  228.  
  229.  
  230.      There are a few problems that need to be worked out before the
  231. interested reader could actually build his or her own "EDACS
  232. TrunkTracker". First, the EDACS system refers to channels in the trunked
  233. system by logical channel numbers which cannot be directly converted
  234. into megahertz. One therefore must have a table translating logical
  235. channel numbers into an actual frequencies for each EDACS system one
  236. plans to monitor. The easy way to get this table seems to be by
  237. monitoring the control channel activity with one scanner while using a
  238. second scanner to figure out which frequency always becomes active in
  239. step with which logical channel number.
  240.  
  241.      The interested reader will also have to figure out how to determine
  242. when the transmission is finished on a particular frequency so that the
  243. scanner can be sent back to the control channel. If you have several
  244. scanners you might want to dedicate one to continuously monitor the
  245. control channel while a second scanner is sent to active frequencies.
  246. The advantage here is that you will immediately know that the party you
  247. are monitoring has stopped transmitting or jumped to a new frequency
  248. since the appropriate ID has either disappeared or gone to a new channel
  249. number in the control channel data stream. For those who would prefer to
  250. use a single scanner: one could low pass filter the raw discriminator
  251. audio output and detect the presence of the subaudible data stream. Your
  252. scanner should return to the control channel once this data stream
  253. terminates. Simplest of all, one can look for the 9600 baud dotting
  254. sequence (the long series of 10101010101010... which comes out as a
  255. 4800Hz tone) that always seems to be sent at the end of each voice
  256. transmission with the same interface used to monitor the control
  257. channel. This dotting sequence is sent before, after, and in between the
  258. anti-scanner tones. My experience is that the program will detect
  259. this dotting sequence reliably and quickly enough to completely
  260. eliminate the anti-scanner tones.
  261.  
  262.      Finally, one quickly tires of listening to the control channel
  263. during idle periods using the single scanner setup. The interested
  264. reader may want to use some of the serial port handshaking lines as an
  265. external mute control instead of supplying power to the op amp
  266. interface.
  267.  
  268.      In summary, the reader should be able to monitor control channel
  269. activity without having to make any changes to the supplied program. If
  270. one wants to start experimenting with "trunktracking" an EDACS system,
  271. the reader will have to hook the serial port TxD line up to a scanner
  272. with any necessary level translation circuitry, place some code into
  273. subroutine set_freak that sends the correct sequence of bytes to your
  274. scanner telling it to change frequencies, uncomment a few sections of
  275. code in subroutine show_active, make sure all serial port parameters are
  276. set correctly (these are the baudrate and the parameters in routine
  277. set8250), place a translation table relating logical channel numbers
  278. with actual frequencies for the specific system you plan to monitor into
  279. array chan[], and tell the program on which logical number the control
  280. channel happens to be. With these changes the program will jump to any
  281. active channel (without regard to the group ID) and jump back to the
  282. control channel when the dotting sequence is detected or any key other
  283. than space or escape is pressed. Improvements are an excercise left for
  284. the reader.
  285.  
  286.  
  287. ------------------------------------------------------------------------
  288.  
  289.                              THE PROGRAM
  290.  
  291.      Windows users beware: this program will probably only work running
  292. from DOS. This is because Windows may interfere with the program's low
  293. level access to your computer's hardware and disrupt the exacting timing
  294. needed to decode the incoming data.
  295.  
  296.      This paragraph gives a short description of how the program works.
  297. Every time the incoming data stream from your scanner changes state, the
  298. op amp data slicer's output also changes polarity. Each time this
  299. happens an interrupt is generated since the data slicer is connected to
  300. one of the serial port status lines. The interrupt handler (comint)
  301. stores the number of system timer clock ticks since the last interrupt
  302. and the data line polarity in a buffer. The main program extracts a raw
  303. bit stream from this buffer by synchronizing a 9600 baud receive "clock"
  304. with the the timing of the transitions and then looking at the data
  305. polarity halfway between the bit transitions. This raw bit stream is
  306. passed on to the frame_sync routine. In addition to checking for the
  307. dotting sequence, routine frame_sync examines this raw bit stream and
  308. extracts the actual data frames which are sent to routine proc_frame
  309. which peforms the error correcting on the raw data. Routine proc_frame
  310. passes its data on to routine proc_cmd which does the CRC check and
  311. formats the received data. The output of proc_cmd is a stream of raw
  312. control channel commands which are sent to routine show. Routine show
  313. figures out changes in system activity. It informs other routines when a
  314. group becomes active and on which channel (routine show_active) or when
  315. a channel is no longer active (routine show_inactive). Currently these
  316. other routines only format and display this data on the screen.
  317.  
  318.      On start up the program quickly checks to see if any data is coming
  319. from the interface. If none is detected it will inform the user of the
  320. problem upon termination. If the interface is working properly the
  321. program immediately starts trying to decode the control channel
  322. information and will also automatically determine the polarity of the
  323. incoming data. When it has locked onto the incoming data the spinwheel
  324. in the upper right hand corner of the screen should start spinning. If
  325. that doesn't happen: make sure you're actually sitting on an EDACS
  326. control channel, see if your interface works with other decoding
  327. packages such as the PD203 POCSAG pager decoder shareware, and if all
  328. else fails look at your discriminator and interface outputs with an
  329. oscilloscope to make sure the data getting into your computer looks like
  330. a relatively clean 9600 baud waveform. You can use a command line option
  331. to tell the program which COM port to use ("/COM:y" where y is the COM
  332. port number) and how many channels are used in your EDACS system
  333. ("/NC:x" where x is the number of channels), although there is no real
  334. reason not to leave the default number of channels at 20.
  335.  
  336.      Compiling the program: snip out bottom portion of this posting,
  337. save it to a file, and feed it into your C compiler with appropriate
  338. settings for a program that uses low level interrupts (in my Borland
  339. Turbo C compiler one should disable the "use register variables"
  340. optimization and the stack warning). The program will definitely compile
  341. with Turbo and Borland C compilers.
  342.  
  343. The actual program listing is given in the second posting.
  344.  
  345. Sorry if I'm wasting bandwidth but I don't have a web page where I
  346. could have put this stuff for interested parties to download. If anyone
  347. wants to try to contact me send email to "qwertyuiop10@juno.com"; but
  348. please keep in mind that I cannot promise a reply.
  349.  
  350. -------------------==== Posted via Deja News ====-----------------------
  351.       http://www.dejanews.com/     Search, Read, Post to Usenet
  352.  
  353.